package com.example.newhabitclock.RecordRoomPackage

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query

@Dao
interface CheckInRecordDao {
    @Insert
    suspend fun insert(record:CheckInRecord)

    //通过habit的id找到check_in_records表中同id的习惯打卡日期date
    @Query("SELECT date FROM check_in_records WHERE habitId = :habitId")
    fun getDatesByHabit(habitId:Int):LiveData<List<String>>
}